<%--
  Created by IntelliJ IDEA.
  User: zhangdeng
  Date: 2020/12/02
  Time: 21:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%@ page import="com.sjsq.po.User" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>头部信息</title>
    <style type="text/css">
        #head{
            background: #eeeeee;height: 60px;
        }
        a{
            font-size: 36px;
        }
    </style>
</head>
<body>
    <%
        User user =(User)session.getAttribute("user");
        if(user == null){
            response.sendRedirect("login.jsp");
        }else {
    %>
    <div id="head">
        <table width="100%">
            <td>欢迎您：<%=user.getName()%></td>
            <td align="right">
                <a href="cart.jsp">我的购物车</a>
                <a href="logout.jsp">安全退出</a>
            </td>
        </table>
    </div>
    <%
        }
    %>
</body>
</html>